Skip to content

Switch RecursionId to any #1477

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Aug 12, 2025
Merged

Switch RecursionId to any #1477

merged 4 commits into from
Aug 12, 2025

Conversation

jakebailey
Copy link
Member

This code is subtly wrong because some of the IDs are uint64 and are being converted to uint32. In long running programs, this would manifest as very strange behavior.

I don't think we actually need anything special here; any is enough to do the right thing and avoids making that same mistake in the same amount of space as it would take to expand the struct to have a uint64 value + padding.

@Copilot Copilot AI review requested due to automatic review settings July 30, 2025 04:15
Copilot

This comment was marked as outdated.

@jakebailey jakebailey requested a review from Copilot August 12, 2025 19:42
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR simplifies the RecursionId type to prevent data corruption from uint64 to uint32 conversions. The change replaces a structured approach with an any-based implementation that preserves the full precision of ID values.

  • Removes the complex RecursionIdKind enum and structured RecursionId with separate kind/id fields
  • Introduces a generic asRecursionId function to constrain valid types while using any for storage
  • Updates all usage sites to use the simplified API

@jakebailey jakebailey added this pull request to the merge queue Aug 12, 2025
Merged via the queue into main with commit 29b9b8a Aug 12, 2025
22 checks passed
@jakebailey jakebailey deleted the jabaile/recursion-id-any branch August 12, 2025 20:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants